<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class SiteUser extends AppModel {
    var $name = 'SiteUser';

    var $order = 'SiteUser.name';

    var $belongsTo = array(
        'SiteCostCenter' => array(
            'foreignKey' => 'site_cost_center_id',
            'fields' => array('name')
        ),
        'User' => array(
            'foreignKey' => 'collector_id',
            'fields' => array('name')
        ),
    );

    var $validate = array(
        'name' => array(
                'notEmpty' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'Site user name is required.',
                    'required' => true,
            ),
        ),
        'site_cost_center_id' => array(
                'notEmpty' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'Cost Center is required.',
                    'required' => true,
            ),
        ),
        'site_id' => array(
                'notEmpty' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'Site is required.',
                    'required' => true,
            ),
        )
    );
}
?>
